Skip to main content

Frontend Utility Functions

This document provides an overview of reusable frontend helper functions available in the codebase. These functions are grouped by their area of functionality.


clientStorage Client Functions

Function NameDescription
setSegmentSets the current segment value in storage.
getSegmentGets the current segment value from storage.
startImpersonationStarts impersonation mode.
getImpersonateStorageKeyGets the storage key for impersonation.
stopImpersonationStops impersonation mode.
isImpersonatingChecks if impersonation mode is active.
setAppViewStorageSettingsSets app view storage settings for a given path.
getAppViewStorageSettingsGets app view storage settings for a given path.
setHiddenAlertsSets hidden alerts for an app.
getHiddenAlertsGets hidden alerts for an app.
setAssetPageFiltersSets asset page filters.
removeAssetPageFiltersRemoves asset page filters.
getAssetPageFiltersGets asset page filters.
setFeedInputRigIdSets the feed input rig ID.
removeFeedInputRigIdRemoves the feed input rig ID.
getFeedInputRigIdGets the feed input rig ID.
getFeatureFlagAppsIsolationGets the feature flag for apps isolation.
FEATURE_FLAG_APPS_ISOLATIONConstant key for the feature flag apps isolation.

sso Client Functions

Function NameDescription
getSSOProviderReturns the SSO provider object for the given platform (e.g., Auth0 or OAuth2).
isSSOPlatformSupportedChecks if the given platform is supported for SSO.

jsonApi Client Functions

Function NameDescription
getCurrentUserReturns the current user information.
getWellViewBhaFetches WellView BHA data.
getWellsFetches a list of wells.
getWellFetches details for a specific well.
getRigFetches details for a specific rig.
patchRigUpdates a rig with new data.
getRigsFetches a list of rigs.
getProgramsFetches a list of programs.
getAssetFetches details for a specific asset.
getAssetsFetches a list of assets.
getResolvedAssetsFetches resolved asset data.
getPadsFetches a list of pads.
getFracFleetsFetches a list of frac fleets.
getDrilloutUnitFetches details for a specific drillout unit.
getDrilloutUnitsFetches a list of drillout units.
deleteAppStorageRecordsDeletes multiple app storage records.
deleteAppStorageDeletes a specific app storage record.
getAppStorageFetches app storage data for a provider, collection, and asset.
getDataAppStorageFetches app storage data for a provider and collection.
getDataAppStorageAggregateFetches aggregated app storage data.
putAppStorageUpdates or creates an app storage record.
putDataAppStorageUpdates or creates a data app storage record.
postAppStorageCreates a new app storage record.
postDataAppStorageCreates a new data app storage record.
getCompetitorAnalysisDataFetches competitor analysis data.
getCompaniesFetches a list of companies.
getPicklistFetches a picklist by name.
getFavoritesFetches user favorites.
getCompanyGoalsFetches goals for a specific company.
mapAssetGetRequestReturns a function to fetch assets by type.
mapAssetByIdGetRequestReturns a function to fetch an asset by ID and type.
postAnnotationCreates a new annotation.
patchAnnotationUpdates an annotation.
deleteAnnotationDeletes an annotation.
getAnnotationsFetches annotations for a dashboard and asset.
getDashboardLastAnnotationsFetches the last annotations for a dashboard and asset.
closeLastAnnotationCloses the last annotation.
postAnnotationCommentAdds a comment to an annotation.
getAnnotationCommentsFetches comments for an annotation.
getFileDownloadLinkReturns a download link for a file.
patchFeedItemCommentUpdates a comment on a feed item.
postFeedItemCommentAdds a comment to a feed item.
deleteFeedItemCommentDeletes a comment from a feed item.
toggleFeedItemLikeToggles like status for a feed item.
patchFeedItemUpdates a feed item.
deleteFeedItemDeletes a feed item.
getUserAutocompleteFetches user autocomplete suggestions.
getS3SignedUrlReturns a signed S3 upload URL.
getS3DownloadLinkReturns a signed S3 download link.
getFracFleetWellsFetches wells for a frac fleet.
getPadWellsFetches wells for a pad.
getTaskFetches a task by ID.
postTaskCreates a new task.
setCurrentUserSettingsSets user settings.
getUserSettingFetches a specific user setting.
logoutLogs out the current user.
getPermissionCheckChecks user permissions.
getDashboardsFetches dashboards.
loginWithAuth0TokenLogs in using an Auth0 token.
getUserAuthSchemasFetches user authentication schemas.
getUserAuthPlatformFetches user authentication platform info.
postUserAuthTokenExchangeExchanges a code for a user auth token.
getLASFileListFetches a list of LAS files for an asset.
getLASMetadataFetches metadata for a LAS file.
getLASFileDataByPageFetches LAS file data by page.
getAllLASFileDataFetches all LAS file data for an asset and file.
getStreamsFetches app streams for an asset.
getAppMediaFetches app media for an app.
deleteAppMediaDeletes app media.
uploadAppMediaUploads app media.
updateAppMediaUpdates app media fields.
getAppHelpContentFetches app help content.
deleteAppHelpContentDeletes app help content.
uploadAppHelpContentUploads app help content.
updateAppHelpContentUpdates app help content.
getAppPackagesFetches app packages.
getAppSettingsTemplatesFetches app settings templates.
getAppSettingsTemplateFetches a specific app settings template.
patchAppSettingsTemplateUpdates an app settings template.
postAppSettingsTemplateCreates a new app settings template.
deleteAppSettingsTemplateDeletes an app settings template.
shareAppSettingsTemplateShares an app settings template with users.
getUsersWithHeadersFetches users with headers.
getUsersFetches a list of users.